<?php
declare (strict_types=1);

namespace Plugin\Device\Model;

use Mine\MineModel;
use Plugin\Organization\Model\RdOrganizeAreaStand;

class RdDeviceRod extends MineModel
{
    /**
     * The table associated with the model.
     *
     * @var string|null
     */
    protected ?string $table = 'rd_device_rod';
    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected array $fillable = [
        'id', 'name', 'stand_id', 'radar_num', 'online', 'created_at', 'updated_at', 'created_by', 'updated_by'
    ];
    /**
     * The attributes that should be cast to native types.
     *
     * @var array
     */
    protected array $casts = [
        'id' => 'integer',
        'online' => 'integer',
        'radar_num' => 'integer'
    ];

    public function stand()
    {
        return $this->belongsTo(RdOrganizeAreaStand::class, 'stand_id', 'id');
    }
    
}